package edu.jxut.reggie.common;



public class EmployeeThreadLocal{
    private static final ThreadLocal<Long> LOCAL = new ThreadLocal<>();

    private EmployeeThreadLocal() {
    }

    /**
     * 将对象放入到ThreadLocal
     *
     * @param id
     */
    public static void set(Long id) {
        LOCAL.set(id);
    }

    /**
     * 返回当前线程中的User对象
     *
     * @return
     */
    public static Long get() {
        return LOCAL.get();
    }

    /**
     * 删除当前线程中的User对象
     */
    public static void remove() {
        LOCAL.remove();
    }

}
